@import "fontsize-and-color.scss";

.main-head {
  background-color: #fff;
  width: 100%;
  min-width: 1226px;

  .container {
    display: flex;
    margin: 0 auto;
    width: 1226px;
    height: 100px;
    align-items: center;
  }

  .logo {
    display: block;
    height: 56px;
    width: 56px;
    object-fit: cover;
    transition: .2s;
    cursor: pointer;

    &:hover {
      transform: translateX(2px);
    }
  }

  .main-head__first-list {
    display: flex;
    align-items: center;
    margin-right: auto;

    &>li {
      font-size: 16px;
      line-height: 100px;
      margin-right: 24px;

      &:hover a {
        color: $mi-theme-color;
        cursor: pointer;
      }

      &:hover .main-head__second-list {
        height: 230px;
        border-top: 1px solid #dcdcdc;
        box-shadow: 0 1px 8px rgba($color: #000000, $alpha: .1);
      }

      &:first-child {
        width: 178px;
        margin: 0;
      }

      &:nth-child(6)>ul>li:nth-child(5)::after {
        display: none;
      }

      &:nth-child(8)>ul>li:nth-child(6)>div>:nth-child(3) {
        color: $main-text-1st;
      }

      a {
        color: $main-text-1st;
      }
    }
  }

  .search-box {
    display: flex;
    align-items: center;
    position: relative;


    .search-input {
      width: 232px;
      height: 48px;
      text-indent: 16px;
      outline: none;
      border: 1px solid $secondary-text-1st;
      font-size: 16px;
      transition: .2s;

      &+ul {
        position: absolute;
        left: 0;
        top: 48px;
        width: 232px;
        display: none;
        flex-direction: column;
        justify-content: center;
        border: 1px solid $mi-theme-color;
        border-top: none;
        background-color: #fff;
        z-index: 9;

        &>li {
          @include font-small;
          color: $main-text-2nd;
          padding: 6px 24px;
          width: 100%;
          cursor: pointer;

          &:hover {
            background-color: rgba($color: #000000, $alpha: .05);
          }
        }
      }

      &::placeholder {
        @include font-normal;
        color: $main-text-3rd;
      }

      &:hover {
        border-color: $secondary-text-2nd;
      }

      &:hover~.search-btn {
        border-color: $secondary-text-2nd;
      }

      &:focus {
        border-color: $mi-theme-color;
      }

      &:focus~.search-btn {
        border-color: $mi-theme-color;
      }

      &:focus~.search-datalist {
        display: flex;
      }

      &:has(~.search-btn:hover) {
        border-color: $main-text-2nd ;
      }

      &:focus:has(~.search-btn:hover) {
        border-color: $mi-theme-color !important;
      }
    }

    .search-btn {
      display: flex;
      justify-content: center;
      align-items: center;
      height: 48px;
      width: 48px;
      border: 1px solid $secondary-text-1st;
      border-left: none;
      margin-left: -1px;
      cursor: pointer;
      transition: .2s;

      span {
        font-size: 20px;
        color: $main-text-3rd;
      }

      &:hover {
        background-color: $mi-theme-color;
        border-color: $mi-theme-color;
      }

      &:hover .iconfont {
        color: #fff;
      }
    }
  }
}